<script>

let promise = new Promise((resolve, reject) => {
    setTimeout(() => {
       resolve(1) 
    }, 1000)
})
promise.then(value => {
    console.log(value)
    return new Promise((resolve, reject) => {
        setTimeout(() => {
            resolve(2)
        },2000)
    })
}).then(value => {
    console.log(value)
})

</script>